﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;

namespace HT.Future.Entities
{
    [Table("T_Product")]
    public class Product: BaseEntity
    {
        /// <summary>
        /// 商品名称
        /// </summary>
        [Required]
        public string Name { get; set; }
        /// <summary>
        /// 商品编码
        /// </summary>
        public string Code { get; set; }
        /// <summary>
        /// 名称拼音
        /// </summary>
        public string Pinyin { get; set; }
        /// <summary>
        /// 拼音首字母
        /// </summary>
        public string FirstLetter { get; set; }
        /// <summary>
        /// 规格描述
        /// </summary>
        public string Description { get; set; }
        /// <summary>
        /// 产品单位
        /// </summary>
        public string UnitName { get; set; }
        /// <summary>
        /// 商品单价
        /// </summary>
        public double Price { get; set; }
        /// <summary>
        /// 商品库存
        /// </summary>
        public int Stock { get; set; } = -1;
        /// <summary>
        /// UPC码
        /// </summary>
        public string UPC { get; set; }
        /// <summary>
        /// SKU码
        /// </summary>
        public string SKU { get; set; }
        /// <summary>
        /// 商品展示图片地址
        /// </summary>
        public string Logo { get; set; }
        /// <summary>
        /// 产品状态
        /// </summary>
        public ProductStatus Status { get; set; }
        /// <summary>
        /// 上架时间
        /// </summary>
        public DateTime? PublishTime { get; set; }
        /// <summary>
        /// 下架时间
        /// </summary>
        public DateTime? NotSaleTime { get; set; }
        /// <summary>
        /// 产品修改时间
        /// </summary>
        public DateTime? ModifyTime { get; set; }
        /// <summary>
        /// 是否参与订单折扣活动
        /// </summary>
        public bool IsDiscount { get; set; }
        /// <summary>
        /// 排序码
        /// </summary>
        public int Sort { get; set; }
        /// <summary>
        /// 商品属性
        /// </summary>
        public virtual ICollection<ProductAttribute> Attributes { get; set; }
        /// <summary>
        /// 商品图片
        /// </summary>
        public virtual ICollection<ProductImage> Images { get; set; }
        /// <summary>
        /// 产品分类id
        /// </summary>
        public int? ProductTypeId { get; set; }
        /// <summary>
        /// 产品分类对象
        /// </summary>
        public virtual ProductType ProductType { get; set; }

    }
}
